package com.example.jasypt;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class JasyptApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext app = SpringApplication.run(JasyptApplication.class, args);

        // myParams.planText.user: hello
        // myParams.planText.pwd:  world
        // myParams.encode.user: ENC(OFkFXBNcBoHPWfkBlLjH5w==)
        // myParams.encode.pwd:  ENC(rOPdwE7SCz/5sg8JnAlnxQ==)
        System.out.println("myParams.planText.user： " + app.getEnvironment().getProperty("myParams.planText.user"));
        System.out.println("myParams.planText.pwd： " + app.getEnvironment().getProperty("myParams.planText.pwd"));
        System.out.println("myParams.planText.txt1： " + app.getEnvironment().getProperty("myParams.planText.txt1"));
        System.out.println("myParams.planText.txt2： " + app.getEnvironment().getProperty("myParams.planText.txt2"));
        System.out.println("-------------------------");
        System.out.println("myParams.encode.user： " + app.getEnvironment().getProperty("myParams.encode.user"));
        System.out.println("myParams.encode.pwd： " + app.getEnvironment().getProperty("myParams.encode.pwd"));
//        System.out.println("myParams.encode.txt1： " + app.getEnvironment().getProperty("myParams.encode.txt1"));
//        System.out.println("myParams.encode.txt2： " + app.getEnvironment().getProperty("myParams.encode.txt2"));

    }

}
